package org.cloud.common.config;

import javax.annotation.PostConstruct;

import org.cloud.common.util.FTPUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import lombok.Getter;
import lombok.Setter;

/**
 * ftp配置初始化
 * 
 * @author wangyuan
 * @since 2018年9月17日
 */
@Configuration
@ConfigurationProperties(prefix = "sloth.ftp")
@Setter
@Getter
public class FTPConfig {

    private String hostname;
    private Integer port;
    private String username;
    private String password;
    
    @PostConstruct
    public void init(){
        FTPUtils.setHostname(hostname);
        FTPUtils.setPort(port);
        FTPUtils.setUsername(username);
        FTPUtils.setPassword(password);
    }
}
